package com.cntcdt.api.db.model.base;

import java.io.Serializable;
import java.sql.ResultSet;
import java.util.Date;

import com.cntcdt.api.db.dao.CdtUserDao;
import com.cntcdt.api.utils.CDTToken;
import com.cntcdt.api.utils.EmojiEncodeUtils;
import com.cntcdt.api.utils.EncryUtil;

/**
 * 这是cdt_user的数据传输对象基类,直接与表对应<br>
 */
public abstract class CdtUserModelBase  implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 属性:用户id<br>
     * 含义:用户id<br>
     */
    private Integer id ;
    /**
     * 属性:pwd<br>
     */
    private String pwd;
    /**
     * 属性:nickName<br>
     */
    private String nickName;
    /**
     * 属性:0代表女  1代表男<br>
     * 含义:0代表女  1代表男<br>
     */
    private Integer sex;
    /**
     * 属性:mobile<br>
     */
    private String mobile;
    /**
     * 属性:年龄<br>
     * 含义:年龄<br>
     */
    private Integer age;
    /**
     * 属性:个人签名<br>
     * 含义:个人签名<br>
     */
    private String resume;
    /**
     * 属性:lat<br>
     */
    private Double lat;
    /**
     * 属性:lng<br>
     */
    private Double lng;
    /**
     * 属性:pushToken<br>
     */
    private String pushToken;
    /**
     * 属性:注册来源 1表示android 2表示ios<br>
     * 含义:注册来源 1表示android 2表示ios<br>
     */
    private Integer source;
    /**
     * 属性:phonecode<br>
     */
    private String phonecode;
    /**
     * 属性:表示pushToken的类型，1表示android，2表示ios<br>
     * 含义:表示pushToken的类型，1表示android，2表示ios<br>
     */
    private Integer tokenType;
    /**
     * 属性:0表示普通用户<br>
     * 含义:0表示普通用户<br>
     */
    private Integer userType;
    /**
     * 属性:注册时间<br>
     * 含义:注册时间<br>
     */
    private Date registerTime;
    /**
     * 属性:更新时间<br>
     * 含义:更新时间<br>
     */
    private Date updateTime;
    /**
     * 属性:最后登录时间<br>
     * 含义:最后登录时间<br>
     */
    private Date lastLoginTime;

    private Double money;
    
    private Double preMoney;//押金
    
    private String huanxinAccount;
    
    private String huanxinPassword;
    
    private Double presentMoney;
    
    private Integer presentMoneyTimes;
    
    private String wxOpenId;
    private String wxRefreshToken;
    private String wxAccessToken;
    private String wxCode;
    
    private String headImage;
    
    private String wxUnionid;
    
    private String wxGZHOpenId;
    
    private String userName;
    
    private String version;
    
    private String leancloudClientId;
    
    private Integer isBorrow;
    
    private String leancloudPassword;
    
    private String leancloudUserName;
    
    private Date lastBorrowTime;
    
    private String platform;
    
    private Integer freeTime;
    
    private Integer isShare;
    
    private String accessToken;
    
    private Long numberAccount;
    
    /**
     *  默认构造方法,构造一个默认的CdtUserModelBase对象
     */
    public CdtUserModelBase(){
    }

    /**
     *  构造函数
     *  @param rs 数据库查询结果集
     */
    public CdtUserModelBase(ResultSet rs){
           try{
               this.id = rs.getInt("id");
               this.pwd = rs.getString("pwd");
               this.nickName = rs.getString("nickName");
               this.sex = rs.getInt("sex");
               this.mobile = rs.getString("mobile");
               this.age = rs.getInt("age");
               this.resume = rs.getString("resume");
               this.lat = rs.getDouble("lat");
               this.lng = rs.getDouble("lng");
               this.pushToken = rs.getString("pushToken");
               this.source = rs.getInt("source");
               this.phonecode = rs.getString("phonecode");
               this.tokenType = rs.getInt("tokenType");
               this.userType = rs.getInt("userType");
               this.registerTime = rs.getDate("registerTime");
               this.updateTime = rs.getDate("updateTime");
               this.lastLoginTime = rs.getDate("lastLoginTime");
               this.money = rs.getDouble("money");
               this.preMoney = rs.getDouble("preMoney");
               this.huanxinAccount = rs.getString("huanxinAccount");
               this.huanxinPassword = rs.getString("huanxinPassword");
               this.presentMoney = rs.getDouble("presentMoney");
               this.presentMoneyTimes = rs.getInt("presentMoneyTimes");
               this.wxOpenId = rs.getString("wxOpenId");
               this.wxRefreshToken = rs.getString("wxRefreshToken");
               this.wxAccessToken = rs.getString("wxAccessToken");
               this.wxCode = rs.getString("wxCode");
               this.headImage = rs.getString("headImage");
               this.wxUnionid = rs.getString("wxUnionid");
               this.wxGZHOpenId = rs.getString("wxGZHOpenId");
               this.userName = rs.getString("userName");
               this.version = rs.getString("version");
               this.leancloudClientId = rs.getString("leancloudClientId");
               this.isBorrow = rs.getInt("isBorrow");
               this.leancloudPassword = rs.getString("leancloudPassword");
               this.leancloudUserName = rs.getString("leancloudUserName");
               this.lastBorrowTime = rs.getDate("lastBorrowTime");
               this.platform = rs.getString("platform");
               this.freeTime = rs.getInt("freeTime");
               this.isShare = rs.getInt("isShare");
               this.accessToken = rs.getString("accessToken");
               this.numberAccount = rs.getLong("numberAccount");
           }catch(Exception e) {
              e.printStackTrace(); 
           }
    }

    
    
    public Long getNumberAccount() {
		return numberAccount;
	}

	public void setNumberAccount(Long numberAccount) {
		this.numberAccount = numberAccount;
	}

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	public Integer getIsShare() {
		return isShare;
	}

	public void setIsShare(Integer isShare) {
		this.isShare = isShare;
	}

	public Integer getFreeTime() {
		return freeTime;
	}

	public void setFreeTime(Integer freeTime) {
		this.freeTime = freeTime;
	}

	public String getPlatform() {
		return platform;
	}

	public void setPlatform(String platform) {
		this.platform = platform;
	}

	public Date getLastBorrowTime() {
		return lastBorrowTime;
	}

	public void setLastBorrowTime(Date lastBorrowTime) {
		this.lastBorrowTime = lastBorrowTime;
	}

	public Integer getIsBorrow() {
		return isBorrow;
	}

	public void setIsBorrow(Integer isBorrow) {
		this.isBorrow = isBorrow;
	}



	public String getLeancloudClientId() {
		return leancloudClientId;
	}

	public void setLeancloudClientId(String leancloudClientId) {
		this.leancloudClientId = leancloudClientId;
	}

	public String getLeancloudPassword() {
		return leancloudPassword;
	}

	public void setLeancloudPassword(String leancloudPassword) {
		this.leancloudPassword = leancloudPassword;
	}

	public String getLeancloudUserName() {
		return leancloudUserName;
	}

	public void setLeancloudUserName(String leancloudUserName) {
		this.leancloudUserName = leancloudUserName;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getWxUnionid() {
		return wxUnionid;
	}

	public void setWxUnionid(String wxUnionid) {
		this.wxUnionid = wxUnionid;
	}

	/**
     * 设置属性用户id<br>
     * 含义:用户id<br>
     * @param id 待设置的属性用户id的值
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取属性用户id<br>
     * 含义:用户id<br>
     * @return 属性用户id的值
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置属性pwd<br>
     * @param pwd 待设置的属性pwd的值
     */
    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    /**
     * 获取属性pwd<br>
     * @return 属性pwd的值
     */
    public String getPwd() {
        return pwd;
    }

    /**
     * 设置属性nickName<br>
     * @param nickName 待设置的属性nickName的值
     */
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    /**
     * 获取属性nickName<br>
     * @return 属性nickName的值
     */
    public String getNickName() {
        return EmojiEncodeUtils.filter2CharUTF(nickName);
    }

    /**
     * 设置属性0代表女  1代表男<br>
     * 含义:0代表女  1代表男<br>
     * @param sex 待设置的属性0代表女  1代表男的值
     */
    public void setSex(Integer sex) {
        this.sex = sex;
    }

    /**
     * 获取属性0代表女  1代表男<br>
     * 含义:0代表女  1代表男<br>
     * @return 属性0代表女  1代表男的值
     */
    public Integer getSex() {
        return sex;
    }

    /**
     * 设置属性年龄<br>
     * 含义:年龄<br>
     * @param age 待设置的属性年龄的值
     */
    public void setAge(Integer age) {
        this.age = age;
    }

    /**
     * 获取属性年龄<br>
     * 含义:年龄<br>
     * @return 属性年龄的值
     */
    public Integer getAge() {
        return age;
    }


    /**
     * 设置属性lat<br>
     * @param lat 待设置的属性lat的值
     */
    public void setLat(Double lat) {
        this.lat = lat;
    }

    /**
     * 获取属性lat<br>
     * @return 属性lat的值
     */
    public Double getLat() {
        return lat;
    }

    /**
     * 设置属性lng<br>
     * @param lng 待设置的属性lng的值
     */
    public void setLng(Double lng) {
        this.lng = lng;
    }

    /**
     * 获取属性lng<br>
     * @return 属性lng的值
     */
    public Double getLng() {
        return lng;
    }

    /**
     * 设置属性pushToken<br>
     * @param pushToken 待设置的属性pushToken的值
     */
    public void setPushToken(String pushToken) {
        this.pushToken = pushToken;
    }

    /**
     * 获取属性pushToken<br>
     * @return 属性pushToken的值
     */
    public String getPushToken() {
        return pushToken;
    }

    /**
     * 设置属性注册来源 1表示android 2表示ios<br>
     * 含义:注册来源 1表示android 2表示ios<br>
     * @param source 待设置的属性注册来源 1表示android 2表示ios的值
     */
    public void setSource(Integer source) {
        this.source = source;
    }

    /**
     * 获取属性注册来源 1表示android 2表示ios<br>
     * 含义:注册来源 1表示android 2表示ios<br>
     * @return 属性注册来源 1表示android 2表示ios的值
     */
    public Integer getSource() {
        return source;
    }

    /**
     * 设置属性phonecode<br>
     * @param phonecode 待设置的属性phonecode的值
     */
    public void setPhonecode(String phonecode) {
        this.phonecode = phonecode;
    }

    /**
     * 获取属性phonecode<br>
     * @return 属性phonecode的值
     */
    public String getPhonecode() {
        return phonecode;
    }

    /**
     * 设置属性表示pushToken的类型，1表示android，2表示ios<br>
     * 含义:表示pushToken的类型，1表示android，2表示ios<br>
     * @param tokenType 待设置的属性表示pushToken的类型，1表示android，2表示ios的值
     */
    public void setTokenType(Integer tokenType) {
        this.tokenType = tokenType;
    }

    /**
     * 获取属性表示pushToken的类型，1表示android，2表示ios<br>
     * 含义:表示pushToken的类型，1表示android，2表示ios<br>
     * @return 属性表示pushToken的类型，1表示android，2表示ios的值
     */
    public Integer getTokenType() {
        return tokenType;
    }

    /**
     * 设置属性0表示普通用户<br>
     * 含义:0表示普通用户<br>
     * @param userType 待设置的属性0表示普通用户的值
     */
    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    /**
     * 获取属性0表示普通用户<br>
     * 含义:0表示普通用户<br>
     * @return 属性0表示普通用户的值
     */
    public Integer getUserType() {
        return userType;
    }

    /**
     * 设置属性注册时间<br>
     * 含义:注册时间<br>
     * @param registerTime 待设置的属性注册时间的值
     */
    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

    /**
     * 获取属性注册时间<br>
     * 含义:注册时间<br>
     * @return 属性注册时间的值
     */
    public Date getRegisterTime() {
        return registerTime;
    }

    /**
     * 设置属性更新时间<br>
     * 含义:更新时间<br>
     * @param updateTime 待设置的属性更新时间的值
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 获取属性更新时间<br>
     * 含义:更新时间<br>
     * @return 属性更新时间的值
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置属性最后登录时间<br>
     * 含义:最后登录时间<br>
     * @param lastLoginTime 待设置的属性最后登录时间的值
     */
    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    /**
     * 获取属性最后登录时间<br>
     * 含义:最后登录时间<br>
     * @return 属性最后登录时间的值
     */
    public Date getLastLoginTime() {
        return lastLoginTime;
    }


    /**
     * 比较两个对象在逻辑上是否相等
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof CdtUserModelBase)) {
            return false;
        }

        final CdtUserModelBase otherModel = (CdtUserModelBase) other;
        if (getId()!=null && !getId().equals(otherModel.getId())) {
            return false;
        }
        return true;
    }

    /**
     * 根据主键生成HashCode
     * @see java.lang.Object#hashCode()
     */
    public int hashCode() {
        StringBuffer buffer = new StringBuffer();
        buffer.append('|').append(id);
        return buffer.toString().hashCode();
    }

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getResume() {
		return resume;
	}

	public void setResume(String resume) {
		this.resume = resume;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public Double getPreMoney() {
		return preMoney;
	}

	public void setPreMoney(Double preMoney) {
		this.preMoney = preMoney;
	}

	public String getHuanxinAccount() {
		return huanxinAccount;
	}

	public String getHuanxinPassword() {
		return huanxinPassword;
	}

	public void setHuanxinAccount(String huanxinAccount) {
		this.huanxinAccount = huanxinAccount;
	}

	public void setHuanxinPassword(String huanxinPassword) {
		this.huanxinPassword = huanxinPassword;
	}

	public Double getPresentMoney() {
		return presentMoney;
	}

	public void setPresentMoney(Double presentMoney) {
		this.presentMoney = presentMoney;
	}

	public String getWxOpenId() {
		return wxOpenId;
	}

	public String getWxRefreshToken() {
		return wxRefreshToken;
	}

	public String getWxAccessToken() {
		return wxAccessToken;
	}

	public void setWxOpenId(String wxOpenId) {
		this.wxOpenId = wxOpenId;
	}

	public void setWxRefreshToken(String wxRefreshToken) {
		this.wxRefreshToken = wxRefreshToken;
	}

	public void setWxAccessToken(String wxAccessToken) {
		this.wxAccessToken = wxAccessToken;
	}

	public String getWxCode() {
		return wxCode;
	}

	public void setWxCode(String wxCode) {
		this.wxCode = wxCode;
	}

	public String getHeadImage() {
		return headImage;
	}

	public void setHeadImage(String headImage) {
		this.headImage = headImage;
	}

	public Integer getPresentMoneyTimes() {
		return presentMoneyTimes;
	}

	public void setPresentMoneyTimes(Integer presentMoneyTimes) {
		this.presentMoneyTimes = presentMoneyTimes;
	}

	public String getWxGZHOpenId() {
		return wxGZHOpenId;
	}

	public void setWxGZHOpenId(String wxGZHOpenId) {
		this.wxGZHOpenId = wxGZHOpenId;
	}
}
